/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Cliente.Controller;

import Cliente.Entidade.Cliente;
import Cliente.View.GraficoView;
import CommandGeraGrafico.GerarGraficoCommand;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;

/**
 *
 * @author Caio Valentim
 */
public class GraficoPresenter {

    public GraficoView view = new GraficoView();
    
    private List<Cliente> clientes;  

    

    
    public GraficoPresenter() {
     
     
       view.getBtnGerar().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                if (view.getCbxValores().getSelectedItem().equals("IAC")){
                       gerarGraficoIAC();
                }
                if (view.getCbxValores().getSelectedItem().equals("IMC")){                       
                       gerarGraficoIMC();
                }
                if (view.getCbxValores().getSelectedItem().equals("RCQ")){
                       gerarGraficoRCQ();
                }
                
            }
        });
       
       view.getBtnFechar().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                view.dispose();
            }
        });
       
       
            
        
    }
    
    
    public void gerarGraficoIMC(){
        GerarGraficoCommand gerar = new GerarGraficoCommand(this);
        gerar.gerarGraficoIMC();
    }
    
     private void gerarGraficoIAC(){
        GerarGraficoCommand gerar = new GerarGraficoCommand(this);
        gerar.gerarGraficoIAC();
    }
     
     private void gerarGraficoRCQ(){
        GerarGraficoCommand gerar = new GerarGraficoCommand(this);
        gerar.gerarGraficoRCQ();
    }
    

    
    public List<Cliente> getClientes() {
        return clientes;
    }

    public void setClientes(List<Cliente> clientes) {
        this.clientes = clientes;
    }
    
 
    

}
